package com.ihr360.message.dto;

import com.ihr360.commons.model.entity.StringIdWithTime;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import java.util.List;

/**
 * 消息发送任务
 *
 * @author tom
 * @date 17-12-28
 */
@Entity
@Table(name = "tab_message_send_task")
public class MessageSendTaskDto extends StringIdWithTime {

    public static class MessageType {
        public final static int SMS = 1;
        public final static int WEICHAT = 2;
        public final static int PROGRAM = 3;
        public final static int EMAIL = 4;
    }

    public static class Service {
        public final static int ONECLICKCLOUD = 1;
        public final static int PAYROLLCLOUD = 2;
    }

    public static class DoStatus {
        public final static int DEFAULT = 0;
        public final static int DOING = 1;
        public final static int FINISHED = 2;
    }

    @Column(length = 40, nullable = false)
    private String companyId;

    @Column(length = 40, nullable = false)
    private String userId;

    /**
     * 消息类型
     */
    @Column(nullable = false)
    private int messageType;

    /**
     * 发送服务
     */
    @Column(nullable = false)
    private int service;

    /**
     * 业务实体
     */
    @Column(length = 200, nullable = false)
    private String dataDto;

    /**
     * 电子表ID
     */
    @Column(length = 40, nullable = false)
    private String sheetId;

    /**
     * 处理状态
     */
    @Column(nullable = false)
    private int doStatus;

    @OneToMany(fetch = FetchType.LAZY)
    @JoinColumn(name = "taskId")
    private List<MessageSendRecordDto> messageList;

    public int getMessageType() {
        return messageType;
    }

    public void setMessageType(int messageType) {
        this.messageType = messageType;
    }

    public int getService() {
        return service;
    }

    public void setService(int service) {
        this.service = service;
    }

    public String getDataDto() {
        return dataDto;
    }

    public void setDataDto(String dataDto) {
        this.dataDto = dataDto;
    }

    public int getDoStatus() {
        return doStatus;
    }

    public void setDoStatus(int doStatus) {
        this.doStatus = doStatus;
    }

    public List<MessageSendRecordDto> getMessageList() {
        return messageList;
    }

    public void setMessageList(List<MessageSendRecordDto> messageList) {
        this.messageList = messageList;
    }

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getSheetId() {
        return sheetId;
    }

    public void setSheetId(String sheetId) {
        this.sheetId = sheetId;
    }
}
